/*
 * 作者: junmu
 * 时间: 2025-07-22
 */
package com.hzbc.faceattendance.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;

/**
 * @author junmu
 * @date 2024-01-01
 */
public class ApiResponse<T> {
    @Schema(description = "操作是否成功")
    private boolean flag;

    @Schema(description = "状态码", example = "200")
    private int status;

    @Schema(description = "提示信息", example = "操作成功")
    @NotBlank
    private String msg;

    @Schema(description = "返回数据")
    private T data;
    // 构造函数
    public ApiResponse(boolean flag, int status, String msg, T data) {
        this.flag = flag;
        this.status = status;
        this.msg = msg;
        this.data = data;
    }

    // Getter和Setter方法
    public boolean isFlag() { return flag; }
public void setFlag(boolean flag) { this.flag = flag; }
public int getStatus() { return status; }
public void setStatus(int status) { this.status = status; }
public String getMsg() { return msg; }
public void setMsg(String msg) { this.msg = msg; }
public T getData() { return data; }
public void setData(T data) { this.data = data; }
}